<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>设置画布阴影</title>
    <link rel="stylesheet" href="../../1-Html/global.css">
    <style>
        #canvas {
            display: block;
            margin: 50px auto;
            border: 1px solid #000;
        }
    </style>
</head>
<body>
    <canvas id="canvas" width="400" height="400"></canvas>
</body>
<script>

let canvas = document.getElementById('canvas');
let context = canvas.getContext('2d');          // 得到2d的画笔

// 绘制方法一
context.shadowOffsetX = 10;
context.shadowOffsetY = 5;
context.shadowBlur = 10;
context.shadowColor = "#444";
context.fillStyle = "Blue"
context.fillRect(100, 100, 200, 200);

context.beginPath();
context.fillStyle = "Red";
context.arc(0, 400, 50, 0 ,Math.PI*2)
context.fill();

</script>
</html>